import argparse
from pymavlink import mavutil
from utilities.connect_to_sysid import connect_to_sysid
from utilities.get_autopilot_info import get_autopilot_info

def main():
    parser = argparse.ArgumentParser(description="A simple script to get UAV fcu type example.")
    # parser.add_argument("--altitude", type=int, help="Altitude for the UAV to reach upon takeoff.", default=10)
    parser.add_argument("--sysid", type=int, help="System ID of the UAV to command.", default=1)


    args = parser.parse_args()
    mav_connection = connect_to_sysid('/dev/ttyCH9344USB0', args.sysid)
    
    autopilot_info = get_autopilot_info(mav_connection, args.sysid)
    
    fcu_type = autopilot_info["autopilot"]
    
    
    print(f"connect to {fcu_type}")

if __name__ == "__main__":
    main()